﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Web.backStage.file
{
    public partial class updateNews : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

            string id = Request.QueryString["newsId"];
            Dictionary<int, string> news = new Dictionary<int, string>();
            news = BLL.backStage.NewsManager.getNewsById(id);
            if (!this.IsPostBack)
            {
                Label1.Text = id;
                TextBox1.Text = news[1];
                DropDownList1.Text = news[2];
                TextBox2.Text = news[3];
                TextBox3.Text = news[4];
            }
        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            Dictionary<int, string> news = new Dictionary<int, string>();
            int i = 0;
            news.Add(i++,Label1.Text);
            news.Add(i++, TextBox1.Text);
            news.Add(i++, DropDownList1.Text);
            news.Add(i++, TextBox2.Text);
            news.Add(i++, TextBox3.Text);
            Boolean flag = BLL.backStage.NewsManager.updNews(news);
        }
    }
}